﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Gao.Poker.App.Print;
using Gao.Poker.Domain;

namespace Gao.Poker.App.Game
{
    /// <summary>
    /// Interaction logic for GameControl.xaml
    /// </summary>
    public partial class GameControl : UserControl
    {
        private readonly PlayGame win;

        public GameControl()
        {
            InitializeComponent();
            win = new PlayGame();

            win.CompetitionID = CompetitionID;

            //cc.Content = win.GetPlayInfo();
        }

        public Int32 CompetitionID { get; set; }

        private void Start_Click(object sender, RoutedEventArgs e)
        {
            win.CompetitionID = CompetitionID;
            if (win.Visibility == Visibility.Hidden)
            {
                win.Visibility = Visibility.Visible;
                win.Continue();
            }
            else
            {
                win.Show();
            }
        }

        private void Pause_Click(object sender, RoutedEventArgs e)
        {
            win.Pause();
        }

        private void Continue_Click(object sender, RoutedEventArgs e)
        {
            win.Continue();
        }

        private void Close_Click(object sender, RoutedEventArgs e)
        {
            win.Pause();
            win.Hide();
        }

        private void Caption_Click(object sender, RoutedEventArgs e)
        {
            p.IsOpen = true;
        }

        private void CaptionClose_Click(object sender, RoutedEventArgs e)
        {
            win.SetCaption(txtCaption.Text);
            p.IsOpen = false;
        }

        public void ClosePalyGame()
        {
            win.Close();
        }

        private void MaxWindow_Click(object sender, RoutedEventArgs e)
        {
            win.MaxWindow();
        }
    }
}
